<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
    	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    	<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>修改商品页面</title>
		<link href="${pageContext.request.contextPath }/css/bootstrap.min.css" rel="stylesheet">
	</head>
	<body>
		<div class="container">
			<form id="userAction_save_do" name="Form1" action="${pageContext.request.contextPath}/adminProduct_editSubmit.action" class="form-horizontal" method="post" enctype="multipart/form-data">
				<input type="hidden" name="pid" value="<s:property value="model.pid"/>">
				<input type="hidden" name="image" value="<s:property value="model.image"/>">
				<fieldset>
					<legend>修改商品</legend>
					<div class="form-group">
						<label class="control-label col-sm-2">商品名称</label>
						<div class="col-sm-8">
							<input name="pname" type="text" class="form-control" value="<s:property value="model.pname"/>"/>
						</div>
					</div>
					<div class="form-group">
						<label class="control-label col-sm-2">是否热门</label>
						<div class="col-sm-8 radio">
							<label><input type="radio" name="is_hot" value="1" checked="checked" />是</label>
							<label><input type="radio" name="is_hot" value="1" />否</label>
						</div>
					</div>
					<div class="form-group">
						<label class="control-label col-sm-2">商品价格</label>
						<div class="col-sm-8">
							<input name="price" type="text" class="form-control" value="<s:property value="model.price"/>"/>
						</div>
					</div>
					<div class="form-group">
						<label class="control-label col-sm-2">商品图片</label>
						<div class="col-sm-8">
							<input type="file" name="upload"/>
						</div>
					</div>
					<div class="form-group">
						<label class="control-label col-sm-2">所属商品分类</label>
						<div class="col-sm-8">
							<select name="category.cid" class="form-control">
							  <s:iterator var="c" value="cList">
							  <option value="<s:property value="#c.cid"/>" <s:if test="model.category.cid==#c.cid">selected="selected"</s:if> ><s:property value="#c.cname"/></option>
							  </s:iterator>
							</select>
						</div>
					</div>
					<div class="form-group">
						<label class="control-label col-sm-2">商品描述</label>
						<div class="col-sm-8">
							<textarea name="pdesc" class="form-control" rows="3"><s:property value="model.pdesc"/></textarea>
						</div>
					</div>
					<div class="form-group">
						<label class="control-label col-sm-2"></label>
						<div class="col-sm-8">
							<button type="submit" class="btn btn-default">确定</button>
						</div>
					</div>
				</fieldset>
			</form>
		</div>
	</body>
</html>
